package dyy.zc.campuspay.views;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;

import dyy.zc.campuspay.R;
import dyy.zc.campuspay.bean.Pickers;
import dyy.zc.campuspay.utils.Utils;


/**
 *
 * Created by zhouchuan on 2017/3/15.
 */

public class PopwindowsInput extends PopupWindow {
    private Context mContext;

    public View view;
    public PswInputView pswInputView;
    private String p;
    private void findViewsByIds(View view) {
        pswInputView = Utils.findViewsById(view,R.id.pop_input);
    }
    public PopwindowsInput(Context mContext,PswInputView.InputCallBack inputCallBack)  {
        this.mContext = mContext;
        this.view = LayoutInflater.from(mContext).inflate(R.layout.zhifu_pop, null);
        findViewsByIds(view);
        initData();
        bind(inputCallBack);
        /* 设置弹出窗口特征 */
        // 设置视图
        this.setContentView(this.view);
        // 设置弹出窗体的宽和高
        this.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);
        this.setWidth(RelativeLayout.LayoutParams.MATCH_PARENT);
        // 设置弹出窗体可点击
        this.setFocusable(true);
        this.setOutsideTouchable(false);
        // 实例化一个ColorDrawable颜色为半透明
        ColorDrawable dw = new ColorDrawable(0x00000000);
        // 设置弹出窗体的背景
        this.setBackgroundDrawable(dw);

        // 设置弹出窗体显示时的动画，从底部向上弹出
        this.setAnimationStyle(R.style.xunleiDialogAnimation);

    }

    private void initData() {

    }

    private void bind(PswInputView.InputCallBack inputCallBack) {
        pswInputView.setInputCallBack(inputCallBack);
    }
}
